<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		function fun(n){
			var sum = 1;
			while(n>0){
				sum = sum*n;
				n--
			}
			return sum;
		}
		alert(3+"的阶乘是"+fun(3));
	</script>
</html>
